<template>
  <el-group-title :title="groupTitle">
    <template slot="groupTitle">
      <el-timeline>
        <el-timeline-item
          v-for="(activity, index) in stepsData"
          :key="index"
          :timestamp="activity[timelineItemProps.description]"
        >
          <div class="container">
            <div class="title">{{ activity[timelineItemProps.title] }}</div>
            <div class="timer">{{ activity[timelineItemProps.timer] }}</div>
          </div>
        </el-timeline-item>
      </el-timeline>
    </template>
  </el-group-title>
</template>

<script>
export default {
  name: "verticalTimeLine",
  props: {
    groupTitle: {
      type: String,
      default: ""
    },
    stepsData: {
      type: Array,
      default: () => []
    },
    timelineItemProps: {
      type: Object,
      default: () => ({
        timestamp: "description",
        title: "title",
        timer: "timer"
      })
    }
  }
};
</script>

<style lang="scss" scoped>
.container {
  display: flex;
  .title {
    margin-right: 10px;
  }
}
</style>
